package ACWing.Dynamicprogramming;

import java.util.Scanner;
//	59把数字翻译成字符串
/**
 * @author :chenjie
 * @date :Created 2022/12/3 14:19
 */
public class TranslateNumbersIntoStrings {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        System.out.println(show(s));
    }
    public static int show(String s){
        char[] chars = s.toCharArray();
        int[]dp=new int[s.length()];//表示的是到j状态时转换的方案数
        dp[0]=1;
        for (int i = 1; i < s.length(); i++) {
            dp[i]+=dp[i-1];
                if((chars[i]<'6'&&chars[i-1]=='2')||chars[i-1]=='1'){
                    if(i<2){
                        dp[i]+=dp[i-1];
                        continue;
                    }
                    dp[i]+=dp[i-2];
                }

        }
        return dp[s.length()-1];
    }
}
